package xin.lms.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xin.common.http.response.PageResponse;
import xin.lms.request.AccessLogPageRequest;
import xin.lms.request.EventLogPageRequest;
import xin.lms.service.AccessLogService;
import xin.lms.service.EventService;

/**
 * <pre>
 * Lms Controller
 * </pre>
 * @version 1.0
 * @author lixin_ma@outlook.com
 * @since 2018/7/29 17:17
 */
@RequestMapping("lms")
@RestController
@Api(value = "xin-log", description = "日志管理", position = 3)
public class LmsController {

    @Autowired
    private EventService eventService;

    @ApiOperation(value = "获取事件列表" , notes = "获取事件列表",response = PageResponse.class )
    @GetMapping("event/pageList")
    public PageResponse eventPageList(EventLogPageRequest request){
        return eventService.findPageList(request);
    }

    @Autowired
    private AccessLogService accessLogService;

    @ApiOperation(value = "获取登录日志列表" , notes = "获取登录日志列表",response = PageResponse.class )
    @GetMapping("accessLog/pageList")
    public PageResponse accessPageList(AccessLogPageRequest request){
        return accessLogService.findPageList(request);
    }
}
